/**
 *
 * © Bahadir Zeren 2011
 * bzeren@gmail.com
 * No warranties, express or implied, are made for this program.
 *
 */

package org.baatar.net.tcp;

import org.apache.log4j.Logger;
import org.baatar.net.message.IRequest;
import org.baatar.net.message.IResponse;

/**
 * Interface for the classes which will proccess the Request messages coming to 
 * the TCP Service.
 * 
 * @author b_zeren
 */
public interface IMessageProcessor {
    /**
     * Processes the incoming Request messages.
     * 
     * @param clientIP IP no of the Client.
     * 
     * @param clientPortNr port number of the client.
     * 
     * @param logger to log processing steps or exceptions.
     * 
     * @returns IResponse return value of the processed Request message.
     */
    public IResponse processMessage(String clientIP,
                                    int clientPortNr,
                                    IRequest request,
                                    Logger logger) throws Exception;
}
